|
haptic5 2.2.0
|
API for configuring and manipulating Haptic 5 Click driver. More...
Topics | |
| Haptic 5 Registers List | |
| List of registers of Haptic 5 Click driver. | |
| Haptic 5 Settings | |
| Settings for configuration of Haptic 5 Click driver. | |
| Haptic 5 MikroBUS Map | |
| MikroBUS pin mapping of Haptic 5 Click driver. | |
Functions | |
| void | haptic5_cfg_setup (haptic5_cfg_t *cfg) |
| Haptic 5 configuration object setup function. | |
| err_t | haptic5_init (haptic5_t *ctx, haptic5_cfg_t *cfg) |
| Haptic 5 initialization function. | |
| err_t | haptic5_default_cfg (haptic5_t *ctx) |
| Haptic 5 default configuration function. | |
| err_t | haptic5_set_duty_cycle (haptic5_t *ctx, float duty_cycle) |
| Haptic 5 set duty cycle function. | |
| err_t | haptic5_pwm_stop (haptic5_t *ctx) |
| Haptic 5 stop PWM function. | |
| err_t | haptic5_pwm_start (haptic5_t *ctx) |
| Haptic 5 start PWM function. | |
| void | haptic5_set_dir_forward (haptic5_t *ctx) |
| Haptic 5 set direction forward function. | |
| void | haptic5_set_dir_reverse (haptic5_t *ctx) |
| Haptic 5 set direction reverse function. | |
| void | haptic5_toggle_dir (haptic5_t *ctx) |
| Haptic 5 toggle direction function. | |
| void | haptic5_enable_device (haptic5_t *ctx) |
| Haptic 5 enable device function. | |
| void | haptic5_disable_device (haptic5_t *ctx) |
| Haptic 5 disable device function. | |
API for configuring and manipulating Haptic 5 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
| void haptic5_cfg_setup | ( | haptic5_cfg_t * | cfg | ) |
Haptic 5 configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See haptic5_cfg_t object definition for detailed explanation. |
| err_t haptic5_default_cfg | ( | haptic5_t * | ctx | ) |
Haptic 5 default configuration function.
This function executes a default configuration of Haptic 5 Click board.
| [in] | ctx | : Click context object. See haptic5_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | void haptic5_disable_device | ( | haptic5_t * | ctx | ) |
Haptic 5 disable device function.
This function disables the device by setting the RST pin to LOW.
| [in] | ctx | : Click context object. See haptic5_t object definition for detailed explanation. |
| void haptic5_enable_device | ( | haptic5_t * | ctx | ) |
Haptic 5 enable device function.
This function enables the device by setting the RST pin to HIGH.
| [in] | ctx | : Click context object. See haptic5_t object definition for detailed explanation. |
| err_t haptic5_init | ( | haptic5_t * | ctx, |
| haptic5_cfg_t * | cfg ) |
Haptic 5 initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
| [out] | ctx | : Click context object. See haptic5_t object definition for detailed explanation. |
| [in] | cfg | : Click configuration structure. See haptic5_cfg_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t haptic5_pwm_start | ( | haptic5_t * | ctx | ) |
Haptic 5 start PWM function.
This function starts the PWM output.
| [in] | ctx | : Click context object. See haptic5_t object definition for detailed explanation. |
0 - Success, -1 - Error. | err_t haptic5_pwm_stop | ( | haptic5_t * | ctx | ) |
Haptic 5 stop PWM function.
This function stops the PWM output.
| [in] | ctx | : Click context object. See haptic5_t object definition for detailed explanation. |
0 - Success, -1 - Error. | void haptic5_set_dir_forward | ( | haptic5_t * | ctx | ) |
Haptic 5 set direction forward function.
This function sets the motor direction to forward (DIR pin LOW).
| [in] | ctx | : Click context object. See haptic5_t object definition for detailed explanation. |
| void haptic5_set_dir_reverse | ( | haptic5_t * | ctx | ) |
Haptic 5 set direction reverse function.
This function sets the motor direction to reverse (DIR pin HIGH).
| [in] | ctx | : Click context object. See haptic5_t object definition for detailed explanation. |
| err_t haptic5_set_duty_cycle | ( | haptic5_t * | ctx, |
| float | duty_cycle ) |
Haptic 5 set duty cycle function.
This function sets the PWM duty cycle.
| [in] | ctx | : Click context object. See haptic5_t object definition for detailed explanation. |
| [in] | duty_cycle | : PWM duty cycle value (0.0 to 1.0). |
0 - Success, -1 - Error.